//
// Created by xuyf7 on 2021/9/16.
//

#ifndef NDKPLAYER_NDKPLAYER_H
#define NDKPLAYER_NDKPLAYER_H

#include <cstring>
#include <pthread.h>
#include "AudioChannel.h"
#include "VideoChannel.h"
#include "JNICallbackHelp.h"

extern "C" {
#include "libavformat/avformat.h"
};


class NDKPlayer {
private:
    char *data_source = 0;//指针请赋初始值,否则乱指
    pthread_t pid_prepare;
    AVFormatContext *formatContext = 0;
    AudioChannel *audio_channel = 0;
    VideoChannel *video_channel = 0;
    JNICallbackHelp *jniCallbackHel = 0;

public:
    NDKPlayer(const char *data_source, JNICallbackHelp *jniCallbackHelp);

    virtual ~NDKPlayer();

    void prepare();


    void prepare_();
};


#endif //NDKPLAYER_NDKPLAYER_H
